package com.iocup.keybastion.core.credentials;



import com.pine.sunflower.core.utils.JsonUtils;

import java.util.Objects;

public class TokenCredentials extends Credentials {

    private String token;

    public TokenCredentials(String token) {
        this.token = token;
    }

    public String getToken() {
        return this.token;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        final TokenCredentials that = (TokenCredentials) o;

        return Objects.equals(token, that.token);
    }

    @Override
    public int hashCode() {
        return token != null ? token.hashCode() : 0;
    }

    @Override
    public String toString() {
        return JsonUtils.toString(this);
    }
}
